package com.szqhyxj.youxiangju.biz.onlineChannel.onlineReceipt;

import com.google.gson.annotations.SerializedName;
import com.szqhyxj.youxiangju.sys.BaseResult;
import com.szqhyxj.youxiangju.sys.RetrofitFacade;

import java.util.List;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

/**
 * Created by leung on 2018/12/25.
 */

public class OnlineReceiptModel {
    private interface OnlineReceiptService {
        @FormUrlEncoded
        @POST("online/channelDetail4Trade")
        Observable<BaseResult<OnlineReceiptBean>> getChannelContent(
                @Field("btCode") String btCode,
                @Field("channelId") int channelId,
                @Field("tradeType") String tradeType
        );
    }

    /**
     * 获取通道内容
     */
    public static Observable<BaseResult<OnlineReceiptBean>> getChannelContent(String btCode, int channelId, String tradeType) {
        return RetrofitFacade.Companion.getRetrofit().create(OnlineReceiptService.class).getChannelContent(btCode, channelId, tradeType);
    }


    public static class OnlineReceiptBean {

        @SerializedName("tradeStartTime")
        private String tradeStartTime;

        @SerializedName("fee")
        private double fee;

        @SerializedName("channelName")
        private String channelName;

        @SerializedName("fixedFee")
        private int fixedFee;

        @SerializedName("tradeEndTime")
        private String tradeEndTime;

        @SerializedName("orderAmtMax")
        private int orderAmtMax;

        @SerializedName("channelId")
        private int channelId;

        @SerializedName("orderAmtMin")
        private int orderAmtMin;

        public void setTradeStartTime(String tradeStartTime) {
            this.tradeStartTime = tradeStartTime;
        }

        public String getTradeStartTime() {
            return tradeStartTime;
        }

        public void setFee(double fee) {
            this.fee = fee;
        }

        public double getFee() {
            return fee;
        }

        public void setChannelName(String channelName) {
            this.channelName = channelName;
        }

        public String getChannelName() {
            return channelName;
        }

        public void setFixedFee(int fixedFee) {
            this.fixedFee = fixedFee;
        }

        public int getFixedFee() {
            return fixedFee;
        }

        public void setTradeEndTime(String tradeEndTime) {
            this.tradeEndTime = tradeEndTime;
        }

        public String getTradeEndTime() {
            return tradeEndTime;
        }

        public void setOrderAmtMax(int orderAmtMax) {
            this.orderAmtMax = orderAmtMax;
        }

        public int getOrderAmtMax() {
            return orderAmtMax;
        }

        public void setChannelId(int channelId) {
            this.channelId = channelId;
        }

        public int getChannelId() {
            return channelId;
        }

        public void setOrderAmtMin(int orderAmtMin) {
            this.orderAmtMin = orderAmtMin;
        }

        public int getOrderAmtMin() {
            return orderAmtMin;
        }

        @Override
        public String toString() {
            return
                    "OnlineReceiptBean{" +
                            "tradeStartTime = '" + tradeStartTime + '\'' +
                            ",fee = '" + fee + '\'' +
                            ",channelName = '" + channelName + '\'' +
                            ",fixedFee = '" + fixedFee + '\'' +
                            ",tradeEndTime = '" + tradeEndTime + '\'' +
                            ",orderAmtMax = '" + orderAmtMax + '\'' +
                            ",channelId = '" + channelId + '\'' +
                            ",orderAmtMin = '" + orderAmtMin + '\'' +
                            "}";
        }
    }
}
